using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using T2.Logging.Data.Entities.Interfaces;
using T2.Logging.Data.Entities;
using T2.Logging.Business.Entities.Interfaces;
using T2.Logging.Business.Entities;
using T2.Logging.Business.Entities.Search.Interfaces;
using T2.Logging.Data.Entities.Search.Interfaces;
using T2.Logging.Data.Entities.Search;


//--Change Management Control - Log Business Translator  --**********************
//--Created By: trooks
//--Description: Log Translator
//--Created Date: 03/07/2013 10:05:38
//--*************************************************************

namespace T2.Logging.Business.Translators
{
	public static class LogTranslator 
	{
		public static ILog TranslateToDataLayer(ILog_biz _translateFrom)
        {
            ILog temp = new Log();

		
			if(_translateFrom != null)
			{
			temp.Action = _translateFrom.Action;
			temp.Caller = _translateFrom.Caller;
			temp.Role = _translateFrom.Role;
			temp.PageSize = _translateFrom.PageSize;
			temp.PageNumber = _translateFrom.PageNumber;
			temp.SortColumn = _translateFrom.SortColumn;
			temp.SortType = _translateFrom.SortType;
			temp.TotalRows = _translateFrom.TotalRows;
			temp.LogID = _translateFrom.LogID;
			temp.Priority = _translateFrom.Priority;
			temp.Severity = _translateFrom.Severity;
			temp.Title = _translateFrom.Title;
			temp.MachineName = _translateFrom.MachineName;
			temp.AppDomainName = _translateFrom.AppDomainName;
			temp.Message = _translateFrom.Message;
			temp.TS = _translateFrom.TS;
			temp.CreatedBy = _translateFrom.CreatedBy;
			temp.CreatedDt = _translateFrom.CreatedDt;
			temp.ModifiedBy = _translateFrom.ModifiedBy;
			temp.ModifiedDt = _translateFrom.ModifiedDt;
			temp.ApplicationID = _translateFrom.ApplicationID;
			temp.LogCategoryID = _translateFrom.LogCategoryID;
			}
            return temp;
        }
		
		public static ILogSearch TranslateSearchToDataLayer(ILogSearch_biz _translateFrom)
        {
            ILogSearch temp = new LogSearch();
		
			if(_translateFrom != null)
			{
			temp.Action = _translateFrom.Action;
			temp.Caller = _translateFrom.Caller;
			temp.Role = _translateFrom.Role;
			temp.PageSize = _translateFrom.PageSize;
			temp.PageNumber = _translateFrom.PageNumber;
			temp.SortColumn = _translateFrom.SortColumn;
			temp.SortType = _translateFrom.SortType;
			temp.TotalRows = _translateFrom.TotalRows;
			temp.Title = _translateFrom.Title;
			temp.MachineName = _translateFrom.MachineName;
			temp.AppDomainName = _translateFrom.AppDomainName;
			temp.Message = _translateFrom.Message;
			}
            return temp;
        }

        public static ILog_biz TranslateFromDataLayer(ILog _translateFrom)
        {
            ILog_biz temp = new Log_biz();
			if(_translateFrom != null)
			{
			temp.Action = _translateFrom.Action;
			temp.Caller = _translateFrom.Caller;
			temp.Role = _translateFrom.Role;
			temp.PageSize = _translateFrom.PageSize;
			temp.PageNumber = _translateFrom.PageNumber;
			temp.SortColumn = _translateFrom.SortColumn;
			temp.SortType = _translateFrom.SortType;
			temp.TotalRows = _translateFrom.TotalRows;
			temp.LogID = _translateFrom.LogID;
			temp.Priority = _translateFrom.Priority;
			temp.Severity = _translateFrom.Severity;
			temp.Title = _translateFrom.Title;
			temp.MachineName = _translateFrom.MachineName;
			temp.AppDomainName = _translateFrom.AppDomainName;
			temp.Message = _translateFrom.Message;
			temp.TS = _translateFrom.TS;
			temp.CreatedBy = _translateFrom.CreatedBy;
			temp.CreatedDt = _translateFrom.CreatedDt;
			temp.ModifiedBy = _translateFrom.ModifiedBy;
			temp.ModifiedDt = _translateFrom.ModifiedDt;
			temp.ApplicationID = _translateFrom.ApplicationID;
			temp.LogCategoryID = _translateFrom.LogCategoryID;
			}
            return temp;
        
        }
	
	}
	
}
